#ifndef __WIFI_CONFIG_H
#define __WIFI_CONFIG_H

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "freertos/FreeRTOS.h"
#include "freertos/task.h"
#include "freertos/event_groups.h"
#include "esp_system.h"
#include "nvs_flash.h"
#include "esp_wifi.h"
#include "esp_event.h"
#include <netdb.h>
#include "led.h"
#include "esp_log.h"
// #include "lcd.h"

/* 链接 wifi 名称 */
#define DEFAULT_SSID "HAIMIAN"
/* wifi 密码 */
#define DEFAULT_PWD "Xld2072681!!"
/* 事件标志 */
static EventGroupHandle_t   wifi_event;
#define WIFI_CONNECTED_BIT  BIT0
#define WIFI_FAIL_BIT       BIT1
static const char *TAG = "static_ip";

/* WIFI默认配置结构体初始化宏
 * .sta：STA模式配置
 * .ssid：WiFi名称
 * .password：WiFi密码
 * .threshold.authmode：认证模式(WPA2)
 */
#define WIFICONFIG()   {                            \
    .sta = {                                        \
        .ssid = DEFAULT_SSID,                       \
        .password = DEFAULT_PWD,                    \
        .threshold.authmode = WIFI_AUTH_WPA2_PSK,   \
    },                                              \
}

void wifi_sta_init(void);

#endif /* __WIFI_CONFIG_H */
